package com.lap.framework.tools;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间/日期工具类
 *
 * @author Shuisheng Lao(劳水生)
 * @version 0.0.1
 */
public final class DateUtil {
  private static final String YYYY_MM_DD = "yyyy-MM-dd";
  private static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";

  private DateUtil() {}

  public static String getShort(Date date) {
    return new SimpleDateFormat(YYYY_MM_DD).format(date);
  }

  public static String getLong(Date date) {
    return new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS).format(date);
  }

  public static String getString(String format) {
    return new SimpleDateFormat(format).format(new Date());
  }
}
